package edu.zut.cs.network.dao.service;

import java.sql.SQLException;
import java.util.List;

import edu.zut.cs.network.base.BaseTestCase;
import edu.zut.cs.network.dao.service.impl.BookDaoManagerImpl;
import edu.zut.cs.network.entity.Book;

public class InsertRunnable extends BaseTestCase implements Runnable {
	private String tableName;
	List<Book> bookList;

	public InsertRunnable(List<Book> bookList, String tableName) throws SQLException {
		super();
		this.tableName = tableName;
		this.bookList = bookList;
	}

	BookDaoManager bookDao = new BookDaoManagerImpl();

	@Override
	public void run() {
		logger.info(Thread.currentThread().getName() + "thread：");
		bookDao.insert(bookList, tableName);
	}
}
